package com.changzhi.controller;

import com.changzhi.common.annotation.Verify;
import com.changzhi.common.util.Result;
import com.changzhi.ldyl.model.dto.LanternDto;
import com.changzhi.service.WeekStarService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

/**
 * @Description:周星榜
 * @author: 小落
 * @date: 2021年02月25日
 */
@Slf4j
@CrossOrigin
@RestController
@RequestMapping("weekStar")
public class WeekStarController {

	@Autowired
	private WeekStarService weekStarService;

	@Verify
	@PostMapping("rankings")
	public Result rankings(@RequestBody @Validated LanternDto lanternDto){
		return Result.success(weekStarService.rankings(lanternDto.getUserId(), lanternDto.getType()));
	}
}
